{% extends "contifyuser/base.html" %}

<link href="/{{ media_url }}StartGroup/css/group.css" media="screen, projection" rel="stylesheet" type="text/css"/>

{% block extrajs %}
<script type='text/javascript'>
        $(document).ready(function(){
            first_name =  $('#h_f').val();
            last_name =  $('#h_l').val();
            city =  $('#h_ci').val();
            country =  $('#h_co').val();
            
            if (first_name && last_name && city && country){
                $('#id_first_name').val(first_name);
                $('#id_last_name').val(last_name);
                $('#id_city').val(city);
                $('#id_country').val(country);
            }
        });
</script>
{% endblock %}

{% block content %}
    <input type="hidden" value={{ member.first_name }} id='h_f'>
    <input type="hidden" value={{ member.last_name }} id='h_l'>
    <input type="hidden" value={{ member.city }} id='h_ci'>
    <input type="hidden" value={{ member.country }} id='h_co'>
    <div id="StartGroup1DivId" class="startForm">
	<form method="POST" id="start_group" action="{% url StartGroup.views.startNewGroup %}">
	
	<div class="startFormHeader">
	    <div class="startGroupFormHeaderTitle">Group Details</div>
	</div>
	<div>
	    <div class="nobreak startGroupFormFieldSection startFormLeftSection">
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.group_name.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_name }}</div>
		    <p>{{ start_group_form.errors.group_name }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.group_tagline.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_tagline }}</div>
		    <p>{{ start_group_form.errors.group_tagline }}</p>
		</div>
	    	<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.group_web_address.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_web_address }}</div>
		    <p>{{ start_group_form.errors.group_web_address }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.group_city.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_city }}</div>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span><strong>{{ start_group_form.group_country.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_country }}</div>
		</div>		
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span><strong>{{ start_group_form.group_zipcode.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_zipcode }}</div>
		</div>
	    </div>
	    <div class="nobreak startGroupFormFieldSection startFormRightSection">
		<div class="startFormFieldLine">
		    <div class="nobreak registrationFormInterestsExtraPadding startFormLabel"><span><strong>{{ start_group_form.group_desc.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.group_desc }}</div>
		</div>
	    </div>
	</div>
	
	<div>
	    <div class="nobreak startGroupRegisterSection startRegisterFormHeader startFormLeftSection">
		<div class="startGroupFormHeaderTitle">Account Information</div>
	    </div>
	    <div class="nobreak startGroupRegisterSection startRegisterFormHeader startFormRightSection">
		<div class="startGroupFormHeaderTitle">Login Credentials</div>
	    </div>
	</div>
	<div>
	    <div class="nobreak startGroupRegisterFormFieldSection startFormLeftSection">
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.first_name.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.first_name }}</div>
		    <p>{{ start_group_form.errors.first_name }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.last_name.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.last_name }}</div>
		    <p>{{ start_group_form.errors.last_name }}</p>
		</div>
	    	<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.city.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.city }}</div>
		    <br />
		    <p>{{ start_group_form.errors.city }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span><strong>{{ start_group_form.country.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.country }}</div>
		</div>
	    </div>
	    {% if not user.is_authenticated %}
	    <div class="nobreak startGroupRegisterFormFieldSection startFormRightSection">
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.username.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.username }}</div>
		    <p>{{ start_group_form.errors.username }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.email.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.email }}</div>
		    <p>{{ start_group_form.errors.email }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.password1.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.password1 }}</div>
		    <p>{{ start_group_form.errors.password1 }}</p>
		</div>
		<div class="startFormFieldLine">
		    <div class="nobreak startFormLabel"><span class="startStandardRed">* </span><span><strong>{{ start_group_form.password2.label_tag }}</strong></span></div>
		    <div class="nobreak startFormField">{{ start_group_form.password2 }}</div>
		    <p>{{ start_group_form.errors.password2 }}</p>
		</div>
	    </div>
	    {% endif %}
	</div>
	
	<div class="clearLeftFloat startFormRegisterButton">
	    <input type="submit" value="Register Group"  name='registerGroup'/>
	</div>
	</form>
    </div>
{% endblock %}
